<%= paginate @endpoints %>

<table class="crayons-table" width="100%">
  <thead>
    <tr>
      <th scope="col">Target URL</th>
      <th scope="col">ID</th>
      <th scope="col">Events</th>
      <th scope="col">Source</th>
      <th scope="col">User</th>
      <th scope="col">Created At</th>
    </tr>
  </thead>
  <tbody class="crayons-card">
    <% @endpoints.each do |endpoint| %>
      <tr>
        <td><%= link_to endpoint.target_url, endpoint.target_url %></td>
        <td><%= endpoint.id %></td>
        <td><%= endpoint.events.join(", ") %></td>
        <td><%= endpoint.source %></td>
        <td><%= link_to endpoint.user.username, endpoint.user.path %></td>
        <td><%= endpoint.created_at.strftime("%H:%M %d %b %Y") %></td>
      </tr>
  <% end %>
  </tbody>
</table>

<%= paginate @endpoints %>
